<?php
include_once 'include/init.php';
include_once('include/cls_news.php');
$id = !empty($_GET['id'])?$_GET['id']:0;
$db = new News();
$db->where = array('id'=>$id);//设置where条件
$data = $db->getOne();
$smarty->assign('data',$data);//传递变量

$smarty->display('info.tpl');//加载模板，编译为php文件，再执行编译后php模板


//include_once('templates/index.php');